import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity("device_params_rule", { schema: "charge" })
export class DeviceParamsRule {
  @PrimaryGeneratedColumn({ type: "int", name: "id", unsigned: true })
  id: number;

  @Column("int", {
    name: "owner_id",
    comment: "创建人id",
    unsigned: true,
    default: () => "'0'",
  })
  ownerId: number;

  @Column("varchar", { name: "name", length: 60 })
  name: string;

  @Column("json", { name: "params", nullable: true })
  params: object | null;

  @Column("varchar", { name: "remark", length: 100 })
  remark: string;

  @Column("int", { name: "create_time", unsigned: true, default: () => "'0'" })
  createTime: number;

  @Column("int", { name: "update_time", unsigned: true, default: () => "'0'" })
  updateTime: number;
}
